home *** CD-ROM | disk | FTP | other *** search
- { AMarquee.i for PCQ Pascal }
- { Translated from file AMarquee.h }
- { by Jeremy Friesner }
-
- {$I "Include:Exec/Ports.i"}
-
- type
-
- {***** QMessage ***************************************************}
-
- QMessage = record
- qm_Msg : Message; { Don't directly use the contents of qm_Msg! }
- qm_ID : Integer; { Message ID # of transaction related to this opCode, or -1 if no ID is applicable. }
- qm_Status : Integer; { One of the QERROR_* codes defined in AMarquee headers. }
- qm_Path : String; { Pathname of a node, or NULL if not applicable. }
- qm_Data : Address; { Pointer to beginning of data buffer, or NULL if not applicable. }
- qm_DataLen : Integer; { Length of qm_Data buffer, or 0 if not applicable. }
- qm_ActualLen : Integer; { Length of the data buffer stored on the AMarquee server. }
- qm_ErrorLine : Integer; { Line # of the server source code that generated the error. Useful for debugging. }
- qm_Private : Address; { Private info used by FreeQMessage() }
- end;
- QMessagePtr = ^QMessage;
-
- {***** QSession ***************************************************}
-
- QSession = record
- qMsgPort : MsgPortPtr; { Wait() on this for QMessages! }
- {******************************************************************}
- { Invisible, private info is here... don't trust sizeof(QSession)! }
- {******************************************************************}
- end;
- QSessionPtr = ^QSession;
-
- {***** QRunInfo ***************************************************}
-
- QRunInfo = record
- qr_Allowed : Integer; { The theoretical maximum number of bytes your server may allocate. }
- qr_Alloced : Integer; { The number of bytes currently allocated by your server. }
- qr_Avail : Integer; { The number of bytes that may actually be allocated by your server. }
- qr_CurrentPrivs : Integer; { The bit-chord of QPRIV_* privileges that your client has. }
- qr_PossiblePrivs : Integer; { The bit-chord of QPRIV_* privileges that your client could get if it asked for them. }
- end;
- QRunInfoPtr = ^QRunInfo;
-
- { Different error types that can be returned to the client in QMessages }
- const
- QERROR_NO_ERROR = 0; { Everything is okay }
- QERROR_UNKNOWN = -1; { Don't know what the error was. }
- QERROR_MALFORMED_KEY = -2; { Keystring could not be parsed or "dir" does not exist }
- QERROR_NO_SERVER_MEM = -3; { Server did not have enough mem available to complete request }
- QERROR_NO_CONNECTION = -4; { The connection to the server went south }
- QERROR_UNPRIVILEGED = -5; { You're not allowed to do that! }
- QERROR_UNIMPLEMENTED = -6; { Feature you requested does not exist yet }
- QERROR_NO_CLIENT_MEM = -7; { Your computer didn't have enough memory available to complete an action }
- QERROR_SYS_MESSAGE = -8; { This message is a text message from the sysadmin on the server }
-
- { These error types may be returned by QFreeSession() after a QSession }
- { allocation attempt fails. }
- QERROR_NO_TCP_STACK = -20; { TCP stack wasn't running }
- QERROR_HOSTNAME_LOOKUP = -21; { Hostname lookup of server failed }
- QERROR_ABORTED = -22; { TCP thread got a control-C }
- QERROR_NO_SERVER = -23; { No AMarquee server at requested host/port }
- QERROR_NO_INETD = -24; { The program wasn't launched by inetd }
- QERROR_ACCESS_DENIED = -25; { The server wouldn't accept our connection }
-
- { Flags representing special privileges; used with QRequestPrivileges(), etc }
- QPRIV_KILLCLIENTS = $1; { Can forcible disconnect other clients }
- QPRIV_ADMIN = $2; { Can change ENV variables on server }
- QPRIV_GETSYSMESSAGES = $4; { Can receive system messages }
- QPRIV_SENDSYSMESSAGES = $8; { Can send system messages }
-
- QPRIV_ALL = $F; { all QPRIV_* bits or'd together }
-
- { Flags to use with QGo() }
- QGOF_SYNC = $1; { Send a sync packet when all has settled }
-
-
- { Function prototypes }
- { Translated from file AMarquee_protos.h }
- { by Jeremy Friesner }
-
- Function QNewSession(hostname : String; port : Integer; progname : String) : QSessionPtr;
- External;
- Function QNewSessionAsync(hostname : String; port : Integer; progname : String) : QSessionPtr;
- External;
- Function QFreeSession(session : QSessionPtr) : Integer;
- External;
- Function QDebugOp(session : QSessionPtr; string : String) : Integer;
- External;
- Function QGetOp(session : QSessionPtr; wildpath : String; maxBytes : Integer) : Integer;
- External;
- Function QDeleteOp(session : QSessionPtr; wildpath : String) : Integer;
- External;
- Function QRenameOp(session : QSessionPtr; path : String; newname : String) : Integer;
- External;
- Function QSubscribeOp(session : QSessionPtr; wildpath : String; maxBytes : Integer) : Integer;
- External;
- Function QSetOp(session : QSessionPtr; path : String; buffer : Address; bufferLength : Integer) : Integer;
- External;
- Function QClearSubscriptionsOp(session : QSessionPtr; which : Integer) : Integer;
- External;
- Function QPingOp(session : QSessionPtr) : Integer;
- External;
- Function QInfoOp(session : QSessionPtr) : Integer;
- External;
- Function QSetAccessOp(session : QSessionPtr; newAccess : String) : Integer;
- External;
- Function QGo(session : QSessionPtr; flags : Integer) : Integer;
- External;
- Procedure FreeQMessage(session : QSessionPtr; qmsg : QMessagePtr);
- External;
- Function QNewHostSession(hostnames : String; port : ^Integer; progNames : String) : QSessionPtr;
- External;
- Function QStreamOp(session : QSessionPtr; path : String; buffer : Address; bufferLenggth : Integer) : Integer;
- External;
- Function QNewServerSession(hostNames : String; progNames : String) : QSessionPtr;
- External;
- Function QSetMessageAccessOp(session : QSessionPtr; newAccess : String; maxBytes : Integer) : Integer;
- External;
- Function QMessageOp(session : QSessionPtr; hosts : String; buffer : Address; bufferLength : Integer) : Integer;
- External;
- Function QNumQueuedPackets(session : QSessionPtr) : Integer;
- External;
- Function QNumQueuedBytes(session : QSessionPtr) : Integer;
- External;
- Function QErrorName(error : Integer) : String;
- External;
- Function QRequestPrivilegesOp(session : QSessionPtr; privBits : Integer) : Integer;
- External;
- Function QReleasePrivilegesOp(session : QSessionPtr; privBits : Integer) : Integer;
- External;
- Function QKillClientsOp(session : QSessionPtr; hosts : String) : Integer;
- External;
- Function QSetParameterOp(session : QSessionPtr; paramName : String; newValue : String) : Integer;
- External;
- Function QGetParameterOp(session : QSessionPtr; paramName : String) : Integer;
- External;
- Function QSysMessageOp(session : QSessionPtr; hosts : String; message : String) : Integer;
- External;
- Function QGetAndSubscribeOp(session : QSessionPtr; path : String; buffer : Address; bufferLength : Integer) : Integer;
- External;